package cn.rkylin.oms.goods.dao;

import cn.rkylin.core.IDataBaseFactory;
import cn.rkylin.oms.goods.vo.MdmSkuVO;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Repository;

/**
 * Created by Administrator on 2018-5-18.
 */
@Repository(value = "mdmSkuDAO")
public class MdmSkuDAOImpl implements  IMdmSkuDAO {
    @Autowired
    protected IDataBaseFactory dao;

    @Override
    public MdmSkuVO getMdmSkuByMdmCode(String mdmCode) throws Exception {
        return dao.findOne("selectByPrimaryKeyMdmSku",mdmCode);
    }

    @Override
    public int insert(MdmSkuVO mdmSkuVO) throws Exception {
        return dao.insert("insertSelectiveMdmSku", mdmSkuVO);
    }

    @Override
    public int update(MdmSkuVO mdmSkuVO) throws Exception {
        return dao.insert("updateByPrimaryKeySelectiveMdmSku", mdmSkuVO);
    }
}
